core: Don't checkout symbolic links via hardlink
authorColin Walters <walters@verbum.org>
Sat, 26 May 2012 15:55:12 +0000 (11:55 -0400)
committerColin Walters <walters@verbum.org>
Sat, 26 May 2012 15:55:12 +0000 (11:55 -0400)
Doing so can easily get us up to the maximum ext4 hardlink count.

src/libostree/ostree-repo.c

index 2274588377e1f87b0fce046cba1950a919c33ae3..a3ff5565a919e283e891b60a50840effe1f4efb7 100644 (file)
@@ -4179,6 +4179,17 @@ find_loose_for_checkout (OstreeRepo             *self,
             }
           self = self->parent_repo;
         }
+      else if (S_ISLNK (stbuf.st_mode))
+        {
+          /* Don't check out symbolic links via hardlink; it's very easy
+           * to hit the maximum number of hardlinks to an inode this way,
+           * especially since right now we have a lot of symbolic links to
+           * busybox.
+           *
+           * fs/ext4/ext4.h:#define EXT4_LINK_MAX              65000
+           */
+          self = self->parent_repo;
+        }
       else
         break;